package com.yfqy.app.domain.mapper;

import com.yfqy.app.domain.entity.CategoryAttributeValue;
import com.yfqy.app.modules.product.vo.AttributeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface CategoryAttributeValueMapper {

    int insert(CategoryAttributeValue record);

    CategoryAttributeValue selectByPrimaryKey(Long id);

    int batchInsert(@Param("cavList") List<CategoryAttributeValue> cavList);

    int updateStatusByCategoryById(@Param("categoryId") Long id, @Param("modifiedBy") Long modifiedBy);

    Set<Long> selectAttributeIdsByCategoryId(Long id);

    Integer selectMaxSortByCategoryId(@Param("categoryId") Long categoryId);

    int updateStatusByCategoryByIdAndAttributeIds(@Param("categoryId") Long categoryId,
                                                  @Param("attributesToDelete") Set<Long> attributesToDelete,
                                                  @Param("modifiedBy") Long modifiedBy);

    List<CategoryAttributeValue> selectByCategoryIdAndAttributeIds(@Param("categoryId") Long categoryId, @Param("attributesToUpdate") Set<Long> attributesToUpdate);

    void batchUpdate(@Param("attributesToUpdateList") List<CategoryAttributeValue> attributesToUpdateList,
                     @Param("modifiedBy") Long modifiedBy);

    List<AttributeVO> selectForUpdateByCategoryId(@Param("categoryId") Long categoryId);

    List<AttributeVO> selectByCategoryId(@Param("categoryId") Long categoryId);
}